<%--
  Created by IntelliJ IDEA.
  User: G
  Date: 2019/6/16
  Time: 13:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.Statement" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="java.sql.DriverManager" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!doctype html>
<html>
<head>
    <meta charset="UTF-8"/>
    <title>后台管理</title>
    <link rel="stylesheet" type="text/css" href="../css/common.css"/>
    <link rel="stylesheet" type="text/css" href="../css/main.css"/>
    <link href="http://hovertree.com/texiao/hovertreeshow/hovertreeshow.css" rel="stylesheet" />
    <script src="http://down.hovertree.com/jquery/jquery-1.12.1.min.js"></script>
</head>
<%
    try {
        Connection con = null;
        Statement stmt = null;
        ResultSet rs = null;
        Class.forName("org.h2.Driver");
        /*url后面加的?useUnicode=true&characterEncoding=gbk，是为了处理向数据库中添加数据时出现乱码的问题。*/
        String url = "jdbc:h2:~/test5";
        con = DriverManager.getConnection(url, "sa", "sa");
        stmt = con.createStatement();
        String sql =  "select * from file ";
        rs = stmt.executeQuery(sql);
%>
<body>
<script src="http://hovertree.com/texiao/hovertreeshow/hovertreeshow.js"></script>
<div class="topbar-wrap white">
    <div class="topbar-inner clearfix">
        <div class="topbar-logo-wrap clearfix">
            <h1 class="topbar-logo none"><a href="../index.jsp" class="navbar-brand">后台管理</a></h1>
            <ul class="navbar-list clearfix">
                <li><a class="on" href="#">首页</a></li>
                <li><a href="#" target="#">网站首页</a></li>
            </ul>
        </div>
        <div class="top-info-wrap">
            <ul class="top-info-list clearfix">
                <li><a href="#">管理员</a></li>
                <li><a href="#">修改密码</a></li>
                <li><a href="#">退出</a></li>
            </ul>
        </div>
    </div>
</div>
<div class="container clearfix">
    <div class="sidebar-wrap">
        <div class="sidebar-title">
            <h1>菜单</h1>
        </div>
        <div class="sidebar-content">
            <ul class="sidebar-list">
                <li>
                    <a href="#"><i class="icon-font">&#xe003;</i>人事管理</a>
                    <ul class="sub-menu">
                        <li><a href="design.html"><i class="icon-font">&#xe008;</i>部门管理</a></li>
                        <li><a href="design.html"><i class="icon-font">&#xe005;</i>员工管理</a></li>
                        <li><a href="file.jsp"><i class="icon-font">&#xe005;</i>文件管理</a></li>
                    </ul>
                </li>
                <li>
                    <a href="#"><i class="icon-font">&#xe018;</i>业务管理</a>
                    <ul class="sub-menu">
                        <li><a href="../UserManager/user.jsp"><i class="icon-font">&#xe046;</i>用户管理</a></li>
                        <li><a href="../ShopManager/shop.jsp"><i class="icon-font">&#xe033;</i>店铺管理</a></li>
                        <li><a href="../ProductManager/product.jsp"><i class="icon-font">&#xe006;</i>商品管理</a></li>
                        <li><a href="../OrderManager/order.jsp"><i class="icon-font">&#xe006;</i>订单管理</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
    <!--/sidebar-->
    <div class="main-wrap">

        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="../index.jsp">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">文件管理</span></div>
        </div>
        <div class="result-wrap">
            <form name="myform" id="myform" method="post">
                <div class="result-title">
                    <div class="result-list">
                        <a href="file_insert.jsp"><i class="icon-font"></i>上传文件</a>
                    </div>
                </div>
                <div class="result-content">
                    <table class="result-tab" width="100%">
                        <tr>
                            <th>文件ID</th>
                            <th>文件名</th>
                            <th>操作</th>
                        </tr>
                        <% while (rs.next()) { //取得下一条记%>
                        <tr>
                            <td><%=rs.getInt("fi_id")%></td>
                            <td><%="D:\\picture"+rs.getString("fi_name")%></td>
                            <td>
                                <a class="link-update" href="/final/Downfile?str=<%=rs.getString("fi_name")%>">下载</a>
                            </td>
                        </tr>
                        <% } %>
                    </table>
                </div>
            </form>
        </div>
    </div>
    <!--/main-->
</div>
</body>
<%
        rs.close();
        stmt.close();
        con.close();
    }catch (Exception e){e.getMessage();}

%>
</html>